<?php
require_once BaseUtil::getModulePath("base")  .  '/forms/BaseForm.php';
//require_once BaseUtil::getModulePath("base")  .  '/validate/Unique.php';

class GiftForm extends BaseForm {
    public function __construct ()
    {
        parent::__construct();
        
        $giftType = new Zend_Form_Element_Select('gift_type');
        $giftType->setLabel($this->translate->_("giftType"));
        $giftTypeArr = array('1'=>$this->translate->_("giftType1"),'2'=>$this->translate->_("giftType2"));
        $giftType->addMultiOptions($giftTypeArr);
        $giftType->setAttrib('onchange','Gift.changeGiftType()');
        $giftType->setAttrib('id','gift_type');
        $this->addElement($giftType);
        
        $title = new Zend_Form_Element_Text('title');
        $title->setLabel($this->translate->_("title"));
        $title->addFilter("StringTrim");
        $title->setAttrib('id','title');
        $this->addElement($title);
        
        $exhaustPoint = new Zend_Form_Element_Text('exhaust_point');
        $exhaustPoint->setLabel($this->translate->_("exhaustPoint"));
        $exhaustPoint->addFilter("StringTrim");
        $exhaustPoint->setAttrib('id','exhaust_point');
        $exhaustPoint->setRequired(true);
        $this->addElement($exhaustPoint);
        
        $minACPoint = new Zend_Form_Element_Text('min_ac_point');
        $minACPoint->setLabel($this->translate->_("minACPoint"));
        $minACPoint->addFilter("StringTrim");
        $minACPoint->setAttrib('id','min_ac_point');
        $minACPoint->setRequired(true);
        $this->addElement($minACPoint);
        
        $imagePath = new Zend_Form_Element_Text('image_path');
        $imagePath->setLabel($this->translate->_("imagePath"));
        $imagePath->addFilter("StringTrim");
        $imagePath->setAttrib('id','image_path');
        $this->addElement($imagePath);
        
        $imageField = new Zend_Form_Element_File('image');
		$imageField->setLabel($this->translate->_('image'));
		$imageField->setAttrib('id','image');
		$this->addElement($imageField);
        
        $description = new Zend_Form_Element_Textarea('description');
        $description->setLabel($this->translate->_("description"));
        $description->addFilter("StringTrim");
        $description->setAttrib('cols','30');
        $description->setAttrib('rows','3');
        $description->setAttrib('id','description');
        $this->addElement($description);
        
        $startDate = new Zend_Form_Element_Text('start_date');
		$startDate->setLabel($this->translate->_('startDate'));
		$startDate->addFilter("StringTrim");
		$startDate->setAttrib('id','start_date');
		$startDate->setRequired(true);
	    $this->addElement($startDate);

		//to
		$endDate = new Zend_Form_Element_Text('end_date');
		$endDate->setLabel($this->translate->_('endDate'));
		$endDate->addFilter("StringTrim");
		$endDate->setAttrib('id','end_date');
		$endDate->setRequired(true);
		$this->addElement($endDate);
		
		$this->setElementDecorators(array(
            'ViewHelper',
            array(array('div' => 'HtmlTag'), array('tag' => 'div',"class" => "form_element")),
        ));
        
    }
    
}
        

?>